import { http } from "@/utils/http";
import type { HttpResult } from "@/utils/http/types";

export function queryNoticeTable(params) {
  return http.request<HttpResult>("get", "/admin/notice/get/table", {
    params: params
  });
}

export function queryNotice(id) {
  return http.request<HttpResult>("get", `/admin/notice/get/${id}`);
}

export function addNotice(params) {
  return http.request<HttpResult>("post", "/admin/notice/insert", {
    data: params
  });
}

export function updateNotice(params) {
  return http.request<HttpResult>("post", "/admin/notice/update", {
    data: params
  });
}

export function deleteNotice(ids) {
  return http.request<HttpResult>("post", `/admin/notice/delete/${ids}`);
}

export function updateNoticeClose(params) {
  return http.request<HttpResult>("post", "/admin/notice/update/close", {
    data: params
  });
}
